﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GameObjects
{
    [Serializable]
    public class Vector
    {
        public MetaData.VectorType VectorType;
        public IList<Hex> Nodes;
        public bool AquaticPass;
        public int Seed;

        public Vector(MetaData.VectorType vectorType, Hex node1, Hex node2, int seed)
            : this(vectorType, false, node1, node2, seed)
        {
        }

        public Vector(MetaData.VectorType vectorType, bool aquaticPass, Hex node1, Hex node2, int seed)
        {
            //if (node1.location.X - node2.location.X > 1 || node1.location.Y - node2.location.Y > 1)
            //    throw new Exception("Hexes are too far apart");

            VectorType = vectorType;
            AquaticPass = aquaticPass;
            Nodes = new List<Hex>
                        {
                            node1,
                            node2
                        };
            Seed = seed;
        }

        //public override string ToString()
        //{
        //    var toString = TerrainType.Name;
        //    toString = AquaticPass ? toString + " (Aquatic Pass)" : toString;
        //    return toString + " " + Nodes[0].ID + " <-> " + Nodes[1].ID;
        //}
    }
}
